home *** CD-ROM | disk | FTP | other *** search
/ Gurewich OLE Controls for Visual Basic 4 / Gurewich OLE Controls for Visual Basic 4.iso / ocxprog / programs / ch17 / myclock / mycloctl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-15  |  1.6 KB  |  69 lines

  1. // mycloctl.h : Declaration of the CMyclockCtrl OLE control class.
  2.  
  3. /////////////////////////////////////////////////////////////////////////////
  4. // CMyclockCtrl : See mycloctl.cpp for implementation.
  5.  
  6. class CMyclockCtrl : public COleControl
  7. {
  8.     DECLARE_DYNCREATE(CMyclockCtrl)
  9.  
  10. // Constructor
  11. public:
  12.     CMyclockCtrl();
  13.  
  14. // Overrides
  15.  
  16.     // Drawing function
  17.     virtual void OnDraw(
  18.                 CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
  19.  
  20.     // Persistence
  21.     virtual void DoPropExchange(CPropExchange* pPX);
  22.  
  23.     // Reset control state
  24.     virtual void OnResetState();
  25.  
  26. // Implementation
  27. protected:
  28.     ~CMyclockCtrl();
  29.  
  30.     DECLARE_OLECREATE_EX(CMyclockCtrl)    // Class factory and guid
  31.     DECLARE_OLETYPELIB(CMyclockCtrl)      // GetTypeInfo
  32.     DECLARE_PROPPAGEIDS(CMyclockCtrl)     // Property page IDs
  33.     DECLARE_OLECTLTYPE(CMyclockCtrl)        // Type name and misc status
  34.  
  35. // Message maps
  36.     //{{AFX_MSG(CMyclockCtrl)
  37.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  38.     afx_msg void OnTimer(UINT nIDEvent);
  39.     //}}AFX_MSG
  40.     DECLARE_MESSAGE_MAP()
  41.  
  42. // Dispatch maps
  43.     //{{AFX_DISPATCH(CMyclockCtrl)
  44.     long m_updateInterval;
  45.     afx_msg void OnUpdateIntervalChanged();
  46.     afx_msg void Beep();
  47.     //}}AFX_DISPATCH
  48.     DECLARE_DISPATCH_MAP()
  49.  
  50.     afx_msg void AboutBox();
  51.  
  52. // Event maps
  53.     //{{AFX_EVENT(CMyclockCtrl)
  54.     void FireNewMinute()
  55.         {FireEvent(eventidNewMinute,EVENT_PARAM(VTS_NONE));}
  56.     //}}AFX_EVENT
  57.     DECLARE_EVENT_MAP()
  58.  
  59. // Dispatch and event IDs
  60. public:
  61.     enum {
  62.     //{{AFX_DISP_ID(CMyclockCtrl)
  63.     dispidUpdateInterval = 1L,
  64.     dispidBeep = 2L,
  65.     eventidNewMinute = 1L,
  66.     //}}AFX_DISP_ID
  67.     };
  68. };
  69.